home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Peter Lewis / PNL Libraries / MyMachineNames.p < prev    next >
Encoding:
Text File  |  1994-08-27  |  644 b   |  37 lines  |  [TEXT/PJMM]

  1. unit MyMachineNames;
  2.  
  3. interface
  4.  
  5.     const
  6.         owner_id = -16096;
  7.         machine_id = -16413;
  8.  
  9.     function GetOwnerName: str255;
  10.     function GetMachineName: str255;
  11.  
  12. implementation
  13.  
  14.     function GetName (id1, id2: integer): str255;
  15.         var
  16.             sh: stringHandle;
  17.     begin
  18.         sh := GetString(id1);
  19.         if sh = nil then
  20.             sh := GetString(id2);
  21.         if sh <> nil then
  22.             GetName := sh^^ { Don't release it, someone else may be using it }
  23.         else
  24.             GetName := 'unnamed';
  25.     end;
  26.  
  27.     function GetOwnerName: str255;
  28.     begin
  29.         GetOwnerName := GetName(owner_id, machine_id);
  30.     end;
  31.  
  32.     function GetMachineName: str255;
  33.     begin
  34.         GetMachineName := GetName(machine_id, owner_id);
  35.     end;
  36.  
  37. end.